<template>
  <div class="campus-binhai">
    <h1>学生查找功能</h1>
    <input v-model="studentId" placeholder="请输入学号" />
    <button @click="searchStudent">查找学生</button>
    <div v-if="studentInfo">
      <h2>学生信息</h2>
      <p>学号: {{ studentInfo.id }}</p>
      <p>姓名: {{ studentInfo.name }}</p>
      <p>专业: {{ studentInfo.major }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      studentId: '',
      studentInfo: null
    }
  },
  methods: {
    searchStudent() {
      // 模拟查找学生信息
      const students = [
        { id: '1001', name: '张三', major: '计算机科学' },
        { id: '1002', name: '李四', major: '软件工程' }
      ]
      this.studentInfo = students.find(student => student.id === this.studentId)
    }
  }
}
</script>